﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity;
using Entity.Car_Rental;

namespace Data.Car_Rental
{
    public interface IRentalRecordRepository : IBackgroundRepository<RentalRecord>
    {
        /// <summary>
        /// 确定订车
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        VMessage RentalCar(RentalRecord entity);

        /// <summary>
        /// 取消订车
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        VMessage CancelRentalCar(RentalRecord entity);
       
        /// <summary>
        /// 完成订车，释放车站，并指向下一排队的订车主
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        VMessage FinishRentalCar(RentalRecord entity);
        /// <summary>
        /// 指定车是否正在被订
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool IsQueued(RentalRecord entity);

        /// <summary>
        /// 前台得到所有模块
        /// </summary>
        /// <returns></returns>
        IQueryable<RentalRecord> GetModelForSite();
        /// <summary>
        /// 后台得到所有模块
        /// </summary>
        /// <returns></returns>
        IQueryable<RentalRecord> GetModelForBackground();
    }
}
